package com.xuanwei.schedule.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xuanwei.dao.entity.XwProduct;
import com.xuanwei.dao.mapper.XwProductMapper;
import org.springframework.stereotype.Service;

/**
 * @Author jiangyong
 * @Description TODO
 * @Date 2019/6/28 11:06
 **/
@Service
public class ProductService {

    private XwProductMapper productMapper;

    public ProductService(XwProductMapper productMapper) {
        this.productMapper = productMapper;
    }

    /**
     * 查询ID
     * @param page 分页
     * @param cpu 核数
     */
    public void findPage(Page<XwProduct> page, Integer cpu,Integer i) {

        productMapper.selectPage(page, new QueryWrapper<XwProduct>()
                .select("id")
                .eq("id % "+cpu, i)
                .eq("status", 0)
                .eq("delete_flag", 0));
    }
}
